<!-- 商品信息管理 -->
<template>
  <div class="mod-config">
      <el-tabs v-model="tabName" type="border-card">
        <el-tab-pane v-for="item in ctgSaleList" :label="item.name" :name="'ctgSale' + item.id" :key="item.id">
          <table-ctg v-if="tabName == 'ctgSale' + item.id" :ctgId="item.ctgId" :ctgSaleId="item.id"></table-ctg>
        </el-tab-pane>
      </el-tabs>
  </div>
</template>

<script>
  import { fetchCtgSaleList } from '@/api/eims/stock-config'

  import TableCtg from './table/ctg-table'

  import { mapGetters } from 'vuex'
  export default {
    data() {
      return {
        ctgSaleList: [],
        tabName: 'ctgSale1'
      }
    },
    components: {
      TableCtg
    },
    created() {
      this.getCtgSaleList()
    },
    computed: {
      ...mapGetters(['permissions'])
    },
    methods: {
      getCtgSaleList() {
        fetchCtgSaleList({type:3}).then(response => {
          if(response.data.code == '0'){
            this.ctgSaleList = response.data.data
          }else{
            this.$message.error(response.data.msg)
          }
          
        })
      }
    }
  }
</script>
